
Module delaystart

    Public Const defaultWaitTime As Int32 = 1000

    Public Sub Main(ByVal args() As String)
        On Error Resume Next
        If args.Length >= 2 Then
            Dim waittime As Int32 = defaultWaitTime
            Dim wait As Boolean = False
            Dim i As Int32
            For i = 2 To args.Length() - 1
                If String.Compare(args(i), "wait", True) = 0 Then
                    wait = True
                End If
            Next
            waittime = Convert.ToInt32(args(0))
            Threading.Thread.Sleep(waittime)
            Shell(args(1), , wait)
        End If
    End Sub

End Module
